package com.teemor.blog.service.impl;

import com.teemor.blog.bean.condition.TbArticleTagsCondition;
import com.teemor.blog.bean.entity.TbArticleTags;
import com.teemor.blog.mapper.TbArticleTagsMapper;
import com.teemor.blog.service.IArticleTagsService;
import com.teemor.common.bean.utils.enums.DataStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author: zhoulk
 * @Description: 原子服务实现
 * @date: 2020/03/14 18:00:12
 */
@Service
public class ArticleTagsServiceImpl implements IArticleTagsService {

    @Autowired
    private TbArticleTagsMapper tbArticleTagsMapper;

    @Override
    public int countArticleTags(TbArticleTagsCondition condition) {
        return tbArticleTagsMapper.countArticleTagsByCondition(condition);
    }

    @Override
    public List<TbArticleTags> qryArticleTagss(TbArticleTagsCondition condition) {
        condition.setDataState(DataStatus.USE.value());
        return tbArticleTagsMapper.selectArticleTagsByCondition(condition);
    }

    @Override
    public TbArticleTags qryArticleTagsById(Integer id) {
        return tbArticleTagsMapper.selectArticleTagsById(id);
    }

    @Override
    public int addArticleTags(TbArticleTags inParam) {
       return tbArticleTagsMapper.insertArticleTags(inParam);
    }

    @Override
    public int updArticleTagsById(TbArticleTags inParam) {
        return tbArticleTagsMapper.updateArticleTagsById(inParam);
    }
}